home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1986 August / Ahoy_Magazine_86-08_1986_Double_L.d64 / Math Mystery2 (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1986-01-01  |  464 b   |  17 lines

  1. 1 print"[147]":poke53280,6:poke53281,1:poke646,0
  2. 2 printtab(6)"commadares...math mystery2"
  3. 3 rem solution by
  4. 4 rem       ron jordan
  5. 5 rem
  6. 10 a=1 : n=7 : dim c(n-1)
  7. 20 for j=a to 8:p$=mid$(str$(a),2)+mid$(str$(j+1),2)
  8. 30 for k=1to9:r$=right$(str$(k),1):if r$=left$(p$,1) or r$=right$(p$,1) then 50
  9. 40 s$=s$+r$
  10. 50 next k
  11. 60 i=n-1 : v=val(s$):if v/11=int(v/11) then print s$,:ct=ct+1
  12. 70 s$=left$(s$,i-1)+right$(s$,n-i)+mid$(s$,i,1)
  13. 80 c(i)=c(i)+1:if c(i)<=n-i then 60
  14. 90 c(i)=0:if i>1 then i=i-1:goto 70
  15. 100 print "count =" ct:s$=""
  16. 110 next j:a=a+1:if a<9 then 20
  17.